
<script setup>
import { ref, watch } from "vue";
const count = ref(0);
const age = ref(0);
//侦听单个数据
// watch([count], (newValue, oldValue) => {
//   console.log(`count发生了变化，老值为${oldValue},新值为${newValue}`);
// });
  // 侦听多少个数据
  watch([count,age], (newValue, oldValue) => {
  console.log(oldValue,newValue);
  
});

</script>
<template>
  <div>
    {{ count }}
   {{ age }}  
  </div>
</template>
<style scoped>
</style>

